package com.example.springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springboot.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    public List<User> findAllUserByPage(@Param("pageNum")int pageNum, @Param("pageSize") int pageSize);
    public Integer findAllUserCount();
    //查询所有用户数据
    public  List<User> findAllUser();
    //查询用户数据
    public List<User> searchUser(@Param("pageNum")int pageNum, @Param("pageSize") int pageSize,
                             @Param("username") String username,@Param("name") String name, @Param("sex") String sex);
    //查询数据总数
    public Integer searchUserCount(@Param("username") String username,@Param("name") String name, @Param("sex") String sex);
    public Integer addUser(@Param("user")User user);
    public String findByUsername(@Param("username")String username);
    public Integer delUserById(@Param("id")Long id);
    public Integer updateUser(@Param("user")User user);
    public User findUserById(@Param("id")Long id);
    public List<User> findUserByIdList(@Param("idlist")List<Long> id);
}
